package com.spark.usermusicService.controller;

import com.spark.R;
import com.spark.usermusicService.entity.User;
import com.spark.usermusicService.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhouqichun
 * @version 1.0
 * @date 2021/7/1 - 07 - 01 - 14:57
 * @description 登录Controller层
 */
@RestController
@RequestMapping("/usermusicService/")
@CrossOrigin
public class LoginController {
    //自动注入LoginService
    @Autowired
    private LoginService loginService;

    @PostMapping("login")
    public R login(@RequestBody User user){
        //调用Service层
        return loginService.login(user);
    }
}
